<?php
#-------------------------------------------------------------------------
# Module: Counters
# Version: 1.0, Jo Morg
# Method: Default Admin
#-------------------------------------------------------------------------
# CMS - CMS Made Simple is (c) 2008 by Ted Kulp (wishy@cmsmadesimple.org)
# This project's homepage is: http://www.cmsmadesimple.org
# The module's homepage is: http://dev.cmsmadesimple.org/projects/skeleton/
#
#-------------------------------------------------------------------------
if(!is_object(@cmsms()))exit;

if (! $this->CheckPermission('Use Counters')) {
  return $this->DisplayErrorPage($id, $params, $returnid,$this->Lang('accessdenied'));
}

if(!empty($params['err'])) {$this->ShowErrors(array($this->Lang($params['err'])));}
if(!empty($params['msg'])) {$this->ShowMessage($this->Lang($params['msg']));}

 
// Tab Infrastructure for Admin Area -- create two tabs, one of which
// is only accessible if permissions are right
if (FALSE == empty($params['active_tab']))
  {
    $tab = $params['active_tab'];
  } else {
  $tab = '';
 }

$tab_header = $this->StartTabHeaders() .
   $this->SetTabHeader('counters',$this->Lang('title_counters'),('counters' == $tab)?true:false);
$this->smarty->assign('start_counters_tab',$this->StartTab('counters', $params));


$tab_header .= $this->SetTabHeader('prefs',$this->Lang('title_mod_prefs'),
      ('prefs' == $tab)?true:false);
$this->smarty->assign('start_prefs_tab',$this->StartTab('prefs', $params));


include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "admin_counters_tab.inc.php");

$this->smarty->assign('tabs_start',$tab_header.$this->EndTabHeaders().$this->StartTabContent());
$this->smarty->assign('tab_end',$this->EndTab());
$this->smarty->assign('tabs_end',$this->EndTabContent());

// Content defines and Form stuff for the admin
$smarty->assign('start_form', $this->CreateFormStart($id, 'save_admin_prefs', $returnid));
$smarty->assign('input_allow_add',$this->CreateInputCheckbox($id, 'allow_add', 1,
   $this->GetPreference('allow_add','0')). $this->Lang('title_allow_add_help'));
$smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit')));

// translated strings
$smarty->assign('title_allow_add',$this->Lang('title_allow_add'));
$smarty->assign('welcome_text',$this->Lang('welcome_text'));

echo $this->ProcessTemplate('adminpanel.tpl');

?>